﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL;

namespace EDM
{
    public class StatusRepository : IStatusRepository
    {

        public List<BLL.StatusText> Search()
        {

            List<BLL.StatusText> statusList = new List<BLL.StatusText>();

            TrainingWorkshopEntities db = new TrainingWorkshopEntities();

            List<EDM.StatusText> edmStatusList= (from m in db.StatusTexts select m).ToList<StatusText>();
            
            foreach(StatusText st in edmStatusList)

            {
                BLL.StatusText bllStatus = new BLL.StatusText();
                bllStatus.StatusId = st.StatusId;
                bllStatus.StatusName = st.StatusName;

                statusList.Add(bllStatus);

            }
            
            return statusList;
        }

    }
}
